<?php
	$dbname = "xxtradexx";
	$user = "xxtradexx";
	$password = "qwerty";
	
	header('Content-Type: text/plain'); 
	$prod = $_POST['productid'];
	$udid = $_POST['udid'];
	
    // Connect to database server
    $hd = mysql_connect("MySQL10.brinkster.com", $user, $password)
          or die ("Unable to connect");

    // Select database

    mysql_select_db ($dbname, $hd)
          or die ("Unable to select database");

    // Execute sample query (insert it into mksync all data in customer table)

    $res = mysql_query("SELECT * FROM xxtradexx.requests where udid='$udid' AND productid='$prod' AND status = 1",$hd) or die ("Unable to select :-(");

	
	$num = mysql_num_rows($res);
	if($num == 0)
		$returnString = "NO";
	else
		$returnString = "YES";
 	mysql_close($hd);

	echo $returnString;
?>
